projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ff40b5
)
Avoid an out-of-bounds access
author
Matthias Clasen
<mclasen@redhat.com>
Fri, 26 Feb 2016 20:50:31 +0000
(15:50 -0500)
committer
Matthias Clasen
<mclasen@redhat.com>
Fri, 26 Feb 2016 20:52:19 +0000
(15:52 -0500)
When the offset gets smaller than min_offset, we can't
access the array at that position.
gtk/gtktextiter.c
patch
|
blob
|
history
diff --git
a/gtk/gtktextiter.c
b/gtk/gtktextiter.c
index dc3891a1b4be89ab928122eb22c2ee2d6760933e..3e2e5f530092b75ae89f082f6d7b8ca193a772a3 100644
(file)
--- a/
gtk/gtktextiter.c
+++ b/
gtk/gtktextiter.c
@@
-3073,9
+3073,12
@@
inside_sentence_func (const PangoLogAttr *attrs,
gint len)
{
/* Find next sentence start or end */
- while (offset >= min_offset &&
- !(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
- --offset;
+ while (!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
+ {
+ --offset;
+ if (offset < min_offset)
+ return FALSE;
+ }
return attrs[offset].is_sentence_start;
}